<template>
  <search-table
      title="部门"
      :headers="headers"
      :search-data="searchDept"
      :do-add="addDept"
      :do-update="updateDept"
      :do-delete="deleteDept"
  ></search-table>
</template>

<script>
import {pageDept,addDept,updateDept,deleteDept} from "@/api/organization/dept"
import SearchTable from "@/components/search-table"
export default {
  name: 'tables',
  components:{SearchTable},
  data() {
    return {
      headers:[
        {key:'id',label:'ID',forbiddenEdit:true},  //默认type : input ，默认允许在添加界面添加相关字段 forbiddenEdit禁止编辑
        {key:'name',label:'部门名'},
        {key:'createTime',label:'创建日期',type:"datetime",forbiddenEdit:true},
        {key:'updateTime',label:'更新日期',type:"date",forbiddenEdit:true},
      ]
    }
  },
  mounted() {

  },
  methods: {
    searchDept(params){
      return pageDept(params);
    },
    addDept(data){
      return addDept(data)
    },
    updateDept(data){
      return updateDept(data)
    },
    deleteDept(data){
      return deleteDept(data.id)
    },

  }
}
</script>

<style scoped lang="scss">

</style>
